/* Figure 5 */

do prelim.do




poisson Refugees logPOPA act2-act9 pol1-pol20 L_GDP_PC_PPP logPOPB act_012-act_019 pol_1-pol_20 L_GDP_PC_PPP_01 L_dist contig comlang_off colonizer /*
*/ i.Year logpmo logpmd if Year>1989 & Year<2014, vce(cluster origin)
matrix V1=e(V)
matrix vecbeta=e(b)

poisson Refugees logPOPA act2-act9 pol1-pol20 L_GDP_PC_PPP logPOPB act_012-act_019 pol_1-pol_20 L_GDP_PC_PPP_01 L_dist contig comlang_off colonizer /*
*/ i.Year logpmo logpmd if Year>1989 & Year<2014, vce(cluster country) from(vecbeta)
matrix V2=e(V)

poisson Refugees logPOPA act2-act9 pol1-pol20 L_GDP_PC_PPP logPOPB act_012-act_019 pol_1-pol_20 L_GDP_PC_PPP_01 L_dist contig comlang_off colonizer /*
*/ i.Year logpmo logpmd if Year>1989 & Year<2014, vce(cluster varpanel) from(vecbeta)

matrix V3=e(V)

capture program drop echange
program define echange, eclass
    matrix Omega=V1+V2-V3
    ereturn repost V = Omega
end
echange
estimate

parmest, label norestore
drop if label=="Year"
drop if label=="Constant"
drop if estimate==0
gen xvar=_n

labmask xvar, values(parm)
scatter estimate xvar, xlabel(, valuelabel) || rcap max95 min95 xvar
